Carbon


ControlUserPaneDrawProcPtr

Header: ControlDefinitions.h Carbon status: Supported

Draws the content of your user pane control in the rectangle of user pane control.

typedef void(* ControlUserPaneDrawProcPtr) (
    ControlRef control, 
    SInt16 part
);

You would declare your function like this if you were to name it MyControlUserPaneDrawCallback:

void MyControlUserPaneDrawCallback (
    ControlRef control, 
    SInt16 part
);
control

A handle to the user pane control in which you wish drawing to occur.

part

The part code of the control you should draw. If 0, draw the entire control.

DISCUSSION

The Control Manager defines the data type ControlUserPaneDrawUPP to identify the universal procedure pointer for this application-defined function:

typedef UniversalProcPtr ControlUserPaneDrawUPP;

You typically use the NewControlUserPaneDrawProc macro like this:

ControlUserPaneDrawUPP myControlUserPaneDrawUPP;

myControlUserPaneDrawUPP = NewControlUserPaneDrawProc(MyControlUserPaneDrawCallback);

You typically use the CallControlUserPaneDrawProc macro like this:

CallControlUserPaneDrawProc(myControlUserPaneDrawUPP, control, part);

Application-defined user pane functions provide you with the ability to create a custom theme-compliant control without writing your own control definition function. A user pane is a general purpose stub control; it can be used as the root control for a window, as well as providing a way to hook in application-defined functions such as those described below. When the Appearance Manager is available, user panes should be used in dialog boxes instead of user items.

Once you have provided a user pane application-defined function, you can call the function SetControlData in order to associate your function with a control. User pane application-defined functions are identified to SetControlData by tag constants; for a description of the tag constants, see the “Control Manager Constants” section.

For example, to set a user pane draw function, pass the constant kControlUserPaneDrawProcTag in the tagName parameter of SetControlData.The Control Manager then draws the control using a universal procedure pointer to your user pane draw function.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)